home *** CD-ROM | disk | FTP | other *** search
/ IBM OEM Software Product … CD For PC Manufacturers / IBM OEM Software - Product Sampler CD for PC Manufacturers.iso / InternetIntranets / Notes / INSTALL.DSK / AUTOMATE.LSS < prev    next >
Text File  |  1995-11-08  |  51KB  |  1,469 lines

  1.  
  2.  
  3. USE "TOOLKIT"
  4. OPTION DECLARE
  5.  
  6.  
  7.  
  8. '*****
  9. 'AUTOMATION
  10. PUBLIC gAutoFile$
  11. PUBLIC gLogFile$
  12. DECLARE PUBLIC FUNCTION Lot_AutoGetProductDestDirSymbol () AS INTEGER
  13. DECLARE PUBLIC FUNCTION Lot_AutoGetBaseDirSymbol () AS STRING
  14. DECLARE PUBLIC FUNCTION Lot_GetKeyValFromResponseFile (Section$, Key$) AS STRING
  15. DECLARE PUBLIC FUNCTION Lot_AutoGetInstallType () AS STRING
  16. DECLARE PUBLIC FUNCTION Lot_AutoGetProgramGroupOrFolder () AS INTEGER
  17. DECLARE PUBLIC FUNCTION Lot_AutoGetSizeOfInstall () AS INTEGER
  18. DECLARE PUBLIC FUNCTION AutoCheckForSpace () AS INTEGER
  19. DECLARE PUBLIC FUNCTION Lot_AutoGetUserInfo () AS INTEGER
  20. DECLARE PUBLIC FUNCTION Lot_AutoConfigureAutoexec () AS INTEGER
  21. DECLARE PUBLIC SUB AutoInstallReboot () 
  22. DECLARE PUBLIC FUNCTION Lot_AutoWriteOutDebugFile () AS INTEGER
  23. DECLARE PUBLIC FUNCTION Lot_AutoIsThisNetLotusApp (LotusIniPath$, ExistingCommDir$) AS INTEGER
  24. DECLARE PUBLIC FUNCTION Lot_AutoConsolidateMoveCopy () AS INTEGER
  25. DECLARE PUBLIC FUNCTION Lot_AutoConsolidateLotusAppDir (gConsolidateSize&) AS INTEGER
  26. DECLARE PUBLIC FUNCTION Lot_AutoChangeLotusAppDir () AS INTEGER
  27. DECLARE PUBLIC FUNCTION Lot_AutoSuiteAppSelect () AS INTEGER
  28. DECLARE PUBLIC FUNCTION Lot_AutoProcessNodeOptions () AS INTEGER
  29. DECLARE PUBLIC FUNCTION Lot_AutoGetSetLicenserInfo () AS INTEGER
  30. DECLARE PUBLIC FUNCTION Lot_AutoInstallCustomize () AS INTEGER
  31. DECLARE PUBLIC FUNCTION Lot_AutoCustomizeShare () AS INTEGER
  32. DECLARE PUBLIC FUNCTION Lot_AutoInstallSuiteCustomize () AS INTEGER
  33. DECLARE PUBLIC FUNCTION Lot_AutoSetSrvNodeOptions () AS INTEGER
  34. DECLARE PUBLIC SUB AutoSetParentDir 
  35.  
  36. DECLARE FUNCTION Lot_AutoCheckRSPPath (rsppath$) AS STRING
  37.  
  38.  
  39. '*************************************************************************
  40. '**                             AUTOMATION
  41. '*************************************************************************
  42. '** PUBLIC FUNCTION Lot_GetKeyValFromResponseFile (Section$, Key$) AS STRING
  43. '**
  44. '** Purpose:   reads in values from the response file. 
  45. '** Author:    Thangv
  46. '** Arguments:  section and key 
  47. '** Returns:   the key value
  48. '*************************************************************************
  49. PUBLIC FUNCTION Lot_GetKeyValFromResponseFile (Section$, Key$) AS STRING
  50.    
  51.    DIM Platform%
  52.    '** Automation Intialization: needs to be moved else where.
  53.    IF gAutoFile$ = "" THEN
  54.     gAutoFile$ = GetSymbolValue(SYM_RSPPATH$)
  55.  
  56.     '** For win95 the FFileExists(init.c)function seems to return true if
  57.          '** the file is in the CWD or at the root.
  58.     '** if in the cwd build the path to rsp file for Getinikey to work.
  59.     Platform% = WhatPlatForm()
  60.          IF (PlatForm% = PLATFORM_WIN95 OR PlatForm% = PLATFORM_WINNT) _
  61.             AND INSTR(gAutoFile$,"\") = 0 THEN 
  62.               gAutoFile$ = GetSymbolValue(SYM_STF_SRCDIR$)+ gAutoFile$ 
  63.          END IF
  64.  
  65.        'DEBUGGING INFO -- PLEASE RETAIN
  66.        'gAutoFile$ = GetSymbolValue(SYM_STF_CWDDIR$)+"auto.rsp"
  67.        'gAutoFile$ = GetSymbolValue(SYM_STF_CWDDIR$)+"autosuit.rsp"
  68.  
  69.     IF DoesFileExist (gAutoFile$,femExists) = 0 THEN
  70.                ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_NORSP)
  71.                ERROR STFQUIT
  72.     END IF
  73.    END IF
  74.    
  75.    Lot_GetKeyValFromResponseFile = GetIniKeyString(gAutoFile$,Section$,Key$)
  76.  
  77. END FUNCTION
  78.  
  79. '*************************************************************************
  80. PUBLIC FUNCTION Lot_AutoGetProductDestDirSymbol () AS INTEGER
  81. '** Purpose:    Get the destination directory symbols
  82. '**             from the RSP file -- used in AUTOMATION             
  83. '**             
  84. '** Author:     Jill Salter Plump     
  85. '** Arguments:  
  86. '** Returns:    TRUE if successful    
  87. '**             
  88. '*************************************************************************
  89. DIM notused%, prodno%, lname$, n%, i%, d%, DirSymbol1$, DirListSymbol$
  90. DIM proddirectory$, errText$, rc$
  91.  
  92. Lot_AutoGetProductDestDirSymbol = FALSE
  93.  n% = Reg_GetNumberOfProducts()
  94.  
  95. ' IF GetSymbolValue(SYM_SINGLESMARTSUITE$) <> gSMARTSUITE$ THEN
  96.      For prodno% = 1 to n%
  97.           lname$ = Reg_GetProductAcronym(prodno%)
  98.           IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" AND lname$ <> "SUIT" Then
  99.             DirListSymbol$ = Reg_GetDirSymbolList(prodno%)    
  100.             d% = Reg_GetNumOfDirectories(prodno%)
  101.                         'd% = GetListLength(DirListSymbol$)
  102.             For i% = 1 to d%
  103.                 DirSymbol1$ = GetListItem(DirListSymbol$, i%)
  104.                  proddirectory$ = Lot_GetKeyValFromResponseFile (lname$,DirSymbol1$)
  105.                                 
  106.                                 proddirectory$ = Lot_AutoCheckRSPPath(proddirectory$)
  107.  
  108.                                 IF LEN(proddirectory$)  > 0 THEN
  109.                                     rc$ = Lot_CallOneProductFunction(1, "PathChange",gNEXT$, _
  110.                          FALSE, |"| + DirSymbol1$ + |",TRUE|)
  111.  
  112.                                     IF rc$ = gBACK THEN
  113.                                                 ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_PRODDIR) + "  " + lname$
  114.                                                 ERROR STFQUIT
  115.                                     END IF
  116.  
  117.                                         SetSymbolValue DirSymbol1$, proddirectory$
  118.  
  119.                                 ELSE
  120.                                         ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_PRODDIR) + "  " + lname$
  121.                                         ERROR STFQUIT
  122.                                 END IF
  123.             Next
  124.         END IF
  125.      Next
  126. ' END IF
  127. Lot_AutoGetProductDestDirSymbol = TRUE
  128. END FUNCTION
  129. '*************************************************************************
  130. FUNCTION Lot_AutoCheckRSPPath (rsppath$) AS STRING
  131. '** Purpose:    To validate paths from RSP file
  132. '**                          
  133. '**             
  134. '** Author:     Jill Salter Plump     
  135. '** Arguments:  The path from the RSP file
  136. '** Returns:    Valid path input -- path with "\" on the end        
  137. '**             Invalid path input (includes bad path, non-existent path
  138. '**                      and empty path) -- empty string
  139. '**
  140. '**             IMPORTANT!!! -- calling functions should check path length
  141. '**                             upon return for LEN > 0 before proceeding.
  142. '**                             If LEN (path$) < 1, caller should singal
  143. '**                             error in RSP file path and quit if default
  144. '**                             path not available.
  145. '*************************************************************************
  146.  
  147. Lot_AutoCheckRSPPATH = ""
  148.  
  149. IF LEN(rsppath$) > 0 THEN
  150.  
  151.         IF RIGHT$(rsppath$, 1) <> "\" THEN
  152.                 rsppath$ = rsppath$+ "\"
  153.         END IF
  154.  
  155.         IF ValidatePath(rsppath$) <> FALSE THEN
  156.                 Lot_AutoCheckRSPPATH = rsppath$
  157.         END IF
  158.         
  159. END IF
  160.  
  161. END FUNCTION
  162. '*************************************************************************
  163. PUBLIC FUNCTION Lot_AutoGetBaseDirSymbol () AS STRING
  164. '** Purpose:    Get the BASEDIR symbol (for Suite)
  165. '**             from the RSP file -- used in AUTOMATION             
  166. '**             
  167. '** Author:     Jill Salter Plump     
  168. '** Arguments:  
  169. '** Returns:    TRUE if successful    
  170. '**                         
  171. '*************************************************************************
  172. DIM notused%, lname$
  173. DIM proddirectory$
  174.  
  175. Lot_AutoGetBaseDirSymbol = ""
  176.  
  177. lname$ = "SUIT"
  178. proddirectory$ = Lot_GetKeyValFromResponseFile (lname$,SYM_BASEDIR$)
  179.  
  180.  
  181. proddirectory$ = Lot_AutoCheckRSPPath(proddirectory$)
  182.  
  183. IF LEN(proddirectory$)  < 1 THEN
  184.         ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_BASEDIR) + "  " + lname$
  185.         ERROR STFQUIT
  186. END IF
  187.  
  188. Lot_AutoGetBaseDirSymbol = proddirectory$
  189.  
  190. END FUNCTION
  191.  
  192. '*************************************************************************
  193. '** PUBLIC FUNCTION Lot_AutoGetInstallType () AS STRING
  194. '**
  195. '** Purpose:   reads in values from the response file. 
  196. '** Author:    Thangv
  197. '** Arguments:  section and key 
  198. '** Returns:   the key value
  199. '*************************************************************************
  200. PUBLIC FUNCTION Lot_AutoGetInstallType () AS STRING
  201.  
  202.     DIM installtype$
  203.     DIM lname$ 
  204.  
  205.     lname$ = "General Information"
  206.  
  207.     installtype$ = Lot_GetKeyValFromResponseFile(lname$,"InstallType")
  208.  
  209.     SELECT CASE installtype$
  210.       case "1"
  211.          Lot_AutoGetInstallType = gSTANDARD$
  212.       case "2"
  213.          Lot_AutoGetInstallType = gSERVER$
  214.       case "3"
  215.          Lot_AutoGetInstallType = gDISTRIBUTION$
  216.       case "4"
  217.          IF GetSymbolValue (SYM_NETWORK$) <> gNODE$ THEN
  218.                 ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_NODE)
  219.                 ERROR STFQUIT
  220.          END IF        
  221.       case else
  222.          ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_INSTALLTYPE)+ "  " + lname$
  223.          ERROR STFQUIT
  224.         'Log Error: Invalid entry
  225.          Lot_AutoGetInstallType = ""    
  226.     END SELECT
  227.  
  228. END FUNCTION
  229.  
  230.  
  231. '*************************************************************************
  232. '** PUBLIC FUNCTION Lot_AutoGetProgramGroupOrFolder () AS INTEGER
  233. '**
  234. '** Purpose:   Reads in values from the response file for Program Group
  235. '**            or start menu folder, to be created under programs in Win95.
  236. '**            Checks value for validity, uses the Default Group for the
  237. '**            first registered product or "Lotus Applications" if the
  238. '**            user's value is invalid. 
  239. '** Author:    Jill Salter Plump, Thangaraj Veerappan
  240. '** Arguments: 
  241. '** Returns:   
  242. '** Replaces:   PROGMANGROUPCB
  243. '*************************************************************************
  244. PUBLIC FUNCTION Lot_AutoGetProgramGroupOrFolder () AS INTEGER
  245. DIM proggroup$, DefaultGroup$, CheckName$, failed%, count%, errText$
  246. DIM lname$, Platform%
  247. DIM InvChar LIST AS STRING
  248.    
  249.    InvChar("*") = "1"
  250.    InvChar("+") = "1"
  251.    InvChar("|") = "1"
  252.    InvChar(":") = "1"
  253.    InvChar(|"|) = "1"
  254.    InvChar("<") = "1"
  255.    InvChar(">") = "1"
  256.    InvChar("?") = "1"
  257.    InvChar("=") = "1"
  258.    InvChar("[") = "1"
  259.    InvChar("]") = "1"
  260.    InvChar("\") = "1"
  261.    InvChar(";") = "1"
  262.    InvChar(",") = "1"
  263.    InvChar("/") = "1"
  264.    InvChar(")") = "1"
  265.    InvChar("(") = "1"
  266.    InvChar(".") = "1"  '* MMETH; I believe that this is a valid character
  267.  
  268.    'TV: These are also invalid characters.
  269.    InvChar("'") = "1" 
  270.    InvChar("@") = "1" 
  271.    InvChar("{") = "1" 
  272.    InvChar("}") = "1" 
  273.    InvChar("#") = "1" 
  274.    InvChar("%") = "1" 
  275.    InvChar("!") = "1" 
  276.    InvChar("`") = "1" 
  277.    InvChar("$") = "1" 
  278.    InvChar("^") = "1" 
  279.    InvChar("~") = "1" 
  280.    InvChar("-") = "1" 
  281.    InvChar("_") = "1" 
  282.    InvChar("&") = "1" 
  283.  
  284. DefaultGroup$=Reg_GetProgManagerGroupName(1)
  285. IF DefaultGroup$="" THEN
  286.    DefaultGroup$="Lotus Application"
  287. END IF
  288.  
  289. lname$ = "General Information"
  290. Platform% = WhatPlatform()
  291. IF Platform% = PLATFORM_WIN95 THEN
  292.     '** Win95
  293.     proggroup$ = Lot_GetKeyValFromResponseFile(lname$,"StartmenuFolder")
  294.  
  295. ELSE
  296.     '** WinNT and Win3.x                                  
  297.      proggroup$ = Lot_GetKeyValFromResponseFile(lname$,"ProgramGroup")
  298. END IF
  299.     
  300. IF proggroup$ = "" THEN
  301.         proggroup$=DefaultGroup$
  302. END IF
  303.  
  304. ' Validate the name if it is a new one
  305. ' The ilegal characters in the name are:
  306. ' * + | : " < > ? + { } \ ; ,  /  MMETH removed the period
  307. ' if the path consists only of " then the group name will be )]
  308. ' if the path consists only of ) or ] or , the group is not created
  309. failed% = 1
  310.  
  311. '** TV: Reject only if the group name consists entirely of Invalid 
  312. '**characters
  313. CheckName$ = proggroup$  
  314. FOR count% = 1 TO LEN(proggroup$)
  315.    IF ISELEMENT(InvChar(LEFT$(CheckName$,1))) = FALSE THEN
  316.       failed% = 0
  317.       EXIT FOR
  318.    END IF 
  319.    CheckName$ = RIGHT$(Checkname$,LEN(CheckName$)-1)
  320. NEXT
  321.  
  322. '*** TV: The " character cannot be permitted.
  323. '** This breaks the script execution later!!
  324. IF INSTR(1,proggroup$,|"|) <> 0 THEN
  325.       failed% = 1
  326. END IF 
  327.  
  328. IF failed% <> 0 THEN
  329.         ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_PROGGROUP) + "  " + lname$
  330.         ERROR STFQUIT
  331. END IF
  332.  
  333. IF Platform% = PLATFORM_WIN95 THEN
  334.      '** Win95: SelectedFolder has complete path 
  335.      proggroup$ = Reg_GetRootFolder() + "\" + proggroup$
  336.      Reg_SetSelectedFolder  1,proggroup$
  337. ELSE
  338.      Reg_SetProgManagerGroup 1,proggroup$
  339. END IF
  340.  
  341. END FUNCTION
  342.  
  343. '*************************************************************************
  344. '** PUBLIC FUNCTION Lot_AutoGetSizeOfInstall () AS STRING
  345. '**
  346. '** Purpose:   reads in values from the response file. 
  347. '** Author:    Jill Salter Plump
  348. '** Arguments: 
  349. '** Returns:   
  350. '** Replaces:   
  351. '*************************************************************************
  352. PUBLIC FUNCTION Lot_AutoGetSizeOfInstall () AS INTEGER
  353.     DIM size$, lname$, i%, nProds%
  354.  
  355.    Lot_AutoGetSizeOfInstall = FALSE
  356.  
  357.    '**** TV: we don't need this check for now
  358.    '** If GetSymbolValue(SYM_SINGLESMARTSUITE$)= gSINGLE$ Then
  359.           lname$ = Reg_GetProductAcronym(1)
  360.         size$ = Lot_GetKeyValFromResponseFile(lname$,"SizeOfInstall")
  361.    '** Else
  362.     'SMARTSUITE: Full & Min for all products. Custom : Set Size of install
  363.     'for each product
  364.    '** End IF
  365.  
  366.    SELECT CASE size$
  367.       case "1"
  368.          size$ = gCOMPLETE$
  369.       case "2"
  370.          size$ = gLAPTOP$
  371.       case "3"
  372.          size$ = gCUSTOM$
  373.       case else
  374.          ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_SIZEOFINSTALL)+ "  " + lname$
  375.          ERROR STFQUIT
  376.         'Log Error: Invalid entry
  377.    END SELECT
  378.  
  379.    SetSymbolValue SYM_SIZEOFINSTALL$, size$
  380.  
  381.    '** Reset all the sizes
  382.    size$ = GetSymbolValue(SYM_SIZEOFINSTALL$)
  383.    nProds% = Reg_GetNumberOfProducts()
  384.    FOR i% = 1 to nProds%
  385.       Reg_SetSelectedInstallType i%, size$
  386.    NEXT
  387.    
  388.    Lot_AutoGetSizeOfInstall = TRUE
  389.  
  390. END FUNCTION
  391. '*************************************************************************
  392.  
  393. PUBLIC FUNCTION AutoCheckForSpace() AS INTEGER
  394. '** Purpose: Checks to see if there is enough space on dest directories
  395. '**          First does a cheap check, followed, if need be by a high
  396. '**          granularity check.
  397. '** Author: Thangaraj Veerappan
  398. '** Arguments:
  399. '**     
  400. '**     
  401. '** Returns: SUCCESS/FAILURE
  402. '**     
  403. '*************************************************************************
  404.     DIM lTicks&, lcb&, lNew&, i%, lcbNeed&, dr$, s$, helpId&, rc$
  405.     DIM notused1$, curcursor&, j%, UNCSym$
  406.  
  407.    '** Try a quick check
  408.    AutoCheckForSpace = SUCCESS
  409.    lcb&          = LcbGetChapterCost("", "", SYM_COST$, SYM_NEEDED$)
  410.    IF lcb& = CLNG(0) THEN
  411.       DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  412.       GOTO ENDCHECK
  413.    END IF
  414.    '** Try A High Granularity Check
  415.    curcursor& = ShowWaitCursor()
  416.    SetListItem "IDC_BMP", 1, STR$(IDD_MAXSCAN_BMP) '** put up the bitmap
  417.    notused1$ = PopupModelessDlg(DB_CHECKSPACE, DB_CHECKSPACE)
  418.    lcb& = GetCopyListCost (gEXTRA, SYM_COST$, SYM_NEEDED$)
  419.    UIPOP 1     '** Bring down DB_CHECKSPACE
  420.    RestoreCursor curcursor&
  421.    IF lcb& = CLNG(0) THEN
  422.       DisplayWhenSpaceIsTight SYM_COST$, SYM_NEEDED$
  423.       GOTO ENDCHECK
  424.    END IF
  425.  
  426.    '** If you get here then there was not enough space (Tab is CHR$(9))
  427.    FOR i% = 1 TO 26
  428.       lcbNeed& = CLNG(GetListItem(SYM_NEEDED$, i%))
  429.       IF  lcbNeed& > 0 THEN
  430.          dr$ = CHR$(ASC("A")+i%-1) + ": " 
  431.          s$  = dr$ & (lcbNeed& + 4)
  432.       END IF
  433.    NEXT
  434.  
  435.    '** unc stuff 
  436.    j%=GetListLength("UNCVOLLIST")
  437.    FOR i% = 1 to j%
  438.       UNCSym$ = GetListItem("UNCVOLLIST",i%)
  439.       lcbNeed& = CLNG(GetListItem(UNCSym$, 3))
  440.       IF lcbNeed&  > 0 THEN
  441. ''** HISHI - Aug/23/95
  442. ''         s$ = Left$(UNCSym$, 18) + CHR$(9) & (lcbNeed& + 4)
  443.          IF IsDBCSFirstAtOffset(UNCSym$, 18) = 0 THEN
  444.             s$ = LeftBP(UNCSym$, 18)
  445.          ELSE
  446.             s$ = LeftBP(UNCSym$, 17)
  447.          END IF
  448.          s$ = s$ & CHR$(9) & (lcbNeed& + 4)
  449. ''** END HISHI
  450.          AddlistItem "IDC_LIST1", s$ + gStrK$
  451.       END IF
  452.    NEXT
  453.  
  454.     ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_DRV_INSUFSPACE)+ s$ + LdString(SID_KBYTE_CHAR)
  455.     ERROR STFQUIT                           
  456.    'Log space needed and drive information: s$
  457.    AutoCheckForSpace = FAILURE
  458.  
  459. ENDCHECK:
  460.  
  461.    RemoveSymbol(SYM_COST$)
  462.    RemoveSymbol(SYM_NEEDED$)
  463.  
  464. END FUNCTION
  465.  
  466. '*************************************************************************
  467. '** PUBLIC FUNCTION Lot_AutoGetUserInfo () AS INTEGER
  468. '**
  469. '** Purpose:   Reads in values from the response file for User Name and
  470. '**            Company Name
  471. '**            
  472. '**            
  473. '** Author:    Jill Salter Plump
  474. '** Arguments: 
  475. '** Returns:   
  476. '** Replaces:   WELCOMECB
  477. '*************************************************************************
  478. PUBLIC FUNCTION Lot_AutoGetUserInfo () AS INTEGER
  479. DIM uname$, company$, defname$, defcompany$
  480. DIM lname$
  481.  
  482. Lot_AutoGetUserInfo = FALSE
  483.  
  484. 'Get Defaults
  485. defname$   = GetSymbolValue(SYM_NAME$)
  486. defcompany$ = GetSymbolValue(SYM_COMPANY$)
  487.  
  488. 'Get User Name from Command Line
  489. uname$ = GetSymbolValue(SYM_USERNAME$)
  490.  
  491. lname$ = "User Registration"
  492.  
  493. IF LEN (uname$) < 1 THEN
  494.         uname$ = Lot_GetKeyValFromResponseFile(lname$,"UserName")
  495.         IF LEN (uname$) < 1 THEN
  496.                 IF LEN (defname$) < 1 THEN
  497.                       uname$ = GetSymbolValue(SYM_NAME$)
  498.                       IF LEN (uname$) < 1 THEN
  499.                         uname$ = "Unknown User"
  500.                         'ADD ERROR
  501.                         'print "Warning:  Unknown User"                                             
  502.                       END IF      
  503.                 ELSE
  504.                      uname$ = defname$
  505.                 END IF                
  506.         END IF        
  507. END IF
  508.         SetSymbolValue SYM_NAME$, uname$
  509.  
  510. company$ = Lot_GetKeyValFromResponseFile(lname$,"CompanyName")
  511. IF LEN (company$) < 1 THEN
  512.         IF LEN (defcompany$) < 1 THEN
  513.               company$ = GetSymbolValue(SYM_COMPANY$)
  514.               IF LEN (company$) < 1  THEN
  515.                 company$ = "Unknown Company"
  516.                 'ADD ERROR
  517.               END IF      
  518.         ELSE
  519.              company$ = defcompany$
  520.         END IF                
  521. END IF        
  522.  
  523.         SetSymbolValue SYM_COMPANY$, company$
  524.  
  525.         Lot_AutoGetUserInfo = TRUE
  526.  
  527. END FUNCTION
  528.  
  529. '*************************************************************************
  530. '** PUBLIC FUNCTION Lot_AutoConfigureAutoexec () AS INTEGER
  531. '**
  532. '** Purpose:  Determines if the autoexec needs to be configured and the
  533. '**           system rebooted. 
  534. '** Author:    Thangv
  535. '** Arguments:   
  536. '** Returns:   TRUE or FALSE
  537. '*************************************************************************
  538. PUBLIC FUNCTION Lot_AutoConfigureAutoexec () AS INTEGER
  539. DIM modflag%, notused1$, reboot$, lname$
  540.  
  541.  Lot_AutoConfigureAutoexec = FALSE
  542.     lname$ = "General Information"
  543.     reboot$ = Lot_GetKeyValFromResponseFile(lname$, "Autoexec")
  544.  
  545.    SELECT CASE reboot$
  546.  
  547.       CASE "1"          ''** Yes button:IDC_OK
  548.      modflag% = 0
  549.      IF GetSymbolValue(SYM_NEEDNOTES$) <> gFALSE$ THEN
  550.         modflag% = 1            '** autoexec needs notes
  551.      END IF
  552.      IF GetSymbolValue(SYM_NEEDSHARE$) <> gFALSE$ THEN
  553.         modflag% = modflag% + 2 '** autoexec needs share
  554.      END IF
  555.      IF modflag% <> FALSE THEN
  556.         notused1$=ModifyAutoexec(modflag%, 1, "AUTOEXEC.LTS")
  557.      END IF
  558.      SetSymbolValue SYM_AUTOEXEC_CHOICE$, gAUTO$
  559.  
  560.       CASE "2"                '** Make Copy button **
  561.      modflag% = 0               '** test flag situation
  562.      IF GetSymbolValue(SYM_NEEDNOTES$) <> gFALSE$ THEN
  563.         modflag% = 1            '** autoexec needs notes
  564.      END IF
  565.      IF GetSymbolValue(SYM_NEEDSHARE$) <> gFALSE$ THEN
  566.         modflag% = modflag% + 2 '** autoexec needs share
  567.      END IF
  568.      IF modflag% <> FALSE THEN
  569.         notused1$=ModifyAutoexec(modflag%, 0, "AUTOEXEC.LTS")
  570.      END IF
  571.      SetSymbolValue SYM_AUTOEXEC_CHOICE$, gAUTOCOPY$
  572.  
  573.       CASE "3"            '** No button
  574.      SetSymbolValue SYM_AUTOEXEC_CHOICE$, gMAN$
  575.  
  576.       CASE ELSE
  577.          ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_REBOOT) + "  " + lname$
  578.          ERROR STFQUIT
  579.         'Log Error: Invalid entry
  580.    END SELECT
  581.  
  582.        SELECT CASE GetSymbolValue(SYM_AUTOEXEC_CHOICE$)
  583.  
  584.           CASE "AUTO"
  585.              'Log appropriate message
  586.           CASE "AUTOCOPY"   
  587.              'Log appropriate message
  588.  
  589.           CASE "MAN"
  590.              'Log appropriate message
  591.  
  592.       END SELECT
  593.  
  594.  Lot_AutoConfigureAutoexec = TRUE
  595.  
  596.  
  597.      
  598.  
  599. END FUNCTION
  600.  
  601. '*************************************************************************
  602. '** PUBLIC SUB AutoInstallReboot () 
  603. '**
  604. '** Purpose:  reboots the system. 
  605. '** Author:    Thangv
  606. '** Arguments:   
  607. '** Returns:   TRUE or FALSE
  608. '*************************************************************************
  609. PUBLIC SUB AutoInstallReboot () 
  610.    DIM notused1$, hwnd&, lr&
  611.       'notused1$ = Lot_CallProductFunctions("PostSuccessReg", gNext, FALSE, gALLPRODUCTS,"")
  612.       hwnd&=FindWindow("LInstallWClass",LdString(SID_INST_WINDOW_TITLE))
  613. ' Japanese build
  614. '     hwnd&=FindWindow("LInstallWClass","âìü[â^âX âCâôâXâgü[âïâvâìâOâëâÇé╓éµéñé▒é╗")
  615.       lr&=SendMessage(hwnd&, WM_COMMAND, UM_REBOOTFLAG, 0)
  616.  
  617. END SUB
  618.  
  619. '*************************************************************************
  620. '** PUBLIC FUNCTION Lot_AutoWriteOutDebugFile () AS INTEGER
  621. '**
  622. '** Purpose:   
  623. '**            
  624. '**            
  625. '**            
  626. '** Author:    Jill Salter Plump
  627. '** Arguments: 
  628. '** Returns:   
  629. '*************************************************************************
  630. PUBLIC FUNCTION Lot_AutoWriteOutDebugFile () AS INTEGER
  631. DIM notused%, mybuffer$, symbolbuff$, uname$
  632. DIM FileExist&, TBD$, spacer$
  633. DIM rc%, lrc&, SectionName$, SectionPref$, SectionNumber%, SectionTag$
  634. DIM KeywordName$, KeywordPref$, KeywordNumber%, KeywordTag$, KeywordValue$
  635. DIM DebugLog$, DebugIni$, AutoRsp$
  636. DIM sname$, scompany$, stype$, sproggroup$, slotusappdir$, ssize$
  637. DIM i%, n%, licensedprod%
  638.  
  639. Lot_AutoWriteOutDebugFile = 0
  640.  
  641. IF GetSymbolValue(SYM_AUTOMATIONINST$) = gTRUE$ THEN
  642.  
  643.   IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
  644.         DebugLog$ = GetWindowsDir() + "autosuit.out"
  645.         DebugIni$ = GetWindowsDir() + "autosuit.ini"
  646.   ELSE
  647.         DebugLog$ = GetWindowsDir() + "auto.out"
  648.         DebugIni$ = GetWindowsDir() + "auto.ini"
  649.   END IF        
  650.  
  651. FileExist&=DoesFileExist(DebugIni$, femExists)
  652.  
  653. IF FileExist& <> 1 THEN
  654.         GOTO NODEBUGLOG
  655. END IF
  656.  
  657. TBD$ = "NOT YET IMPLEMENTED!!!"
  658. spacer$ = ""
  659.  
  660. FileExist&=DoesFileExist(DebugLog$, femExists)
  661.  
  662. IF FileExist&=1 THEN
  663.      RemoveFile DebugLog$, cmoNone
  664. END IF 
  665.  
  666.  
  667.  
  668. 'Initialize the loop
  669. SectionPref$="section"
  670. SectionNumber%=1
  671. SectionTag$=SectionPref$+LTRIM$(STR(SectionNumber%))
  672. SectionName$ = GetIniKeyString(DebugIni$,"Sections", SectionTag$)
  673.  
  674. 'Using auto.ini as a data driver I find all the section entries and
  675. 'log them to the debugging file
  676.  
  677. DO
  678.  
  679. mybuffer$ = spacer$
  680. 'WriteToFile DebugLog$, mybuffer$
  681.  
  682. lrc& = DoesIniSectionExist (gAutoFile$, SectionName$) 
  683.  
  684. mybuffer$ = "[" + SectionName$ + "]"
  685.  
  686. IF lrc& = 1 THEN
  687. '        WriteToFile DebugLog$, mybuffer$
  688.         KeywordPref$="option"
  689.         KeywordNumber%=1
  690.         KeywordTag$=KeywordPref$+LTRIM$(STR(KeywordNumber%))
  691.         'DoMsgBox("KeywordTag$",KeywordTag$ ,MB_OK)
  692.         'DoMsgBox("gSharedIniFile$ where used",gSharedIniFile$ ,MB_OK)
  693.         KeywordName$ = GetIniKeyString(DebugIni$,SectionName$, KeywordTag$)
  694.  
  695.         DO
  696.         SELECT CASE KeywordName$
  697.  
  698.           case "UserName"
  699.                 KeywordValue$ = GetSymbolValue(SYM_NAME$)
  700.                 sname$ = "UserName: " + KeywordValue$
  701.  
  702.                 uname$ = GetSymbolValue(SYM_USERNAME$)
  703.  
  704.                 IF LEN (uname$) >= 1 THEN
  705.                         IF KeywordValue$ <> uname$ THEN
  706.                         KeywordValue$ = "Mismatch:" + uname$ + "from command" + KeywordValue$ + "used"
  707.                         ELSE
  708.                         KeywordValue$ = KeyWordValue$ + "     <----   From Command Line"
  709.                         END IF
  710.                 END IF
  711.  
  712.           case "CompanyName"
  713.                 KeywordValue$ = GetSymbolValue(SYM_COMPANY$)
  714.                 scompany$ = "CompanyName:" + KeywordValue$ 
  715.  
  716.           case "InstallType"
  717.                 KeywordValue$ = GetSymbolValue(SYM_NETWORK$)
  718.                 SELECT CASE KeywordValue$                
  719.                       case gSTANDARD$
  720.                          KeywordValue$ = "1 (Standard)" 
  721.                       case gSERVER$
  722.                          KeywordValue$ = "2 (Server)"
  723.                       case gDISTRIBUTION$
  724.                          KeywordValue$ = "3 (Distribution)"
  725.                 END SELECT
  726.                 stype$ = "InstallType:" + KeywordValue$
  727.  
  728.           case "Autoexec"
  729.                 KeywordValue$ = GetSymbolValue(SYM_AUTOEXEC_CHOICE$)
  730.                 SELECT CASE KeywordValue$
  731.                         case gAUTO$
  732.                            KeywordValue$ = "1 (Auto)"         
  733.                         case gAUTOCOPY$                
  734.                            KeywordValue$ = "2 (AutoCopy)"
  735.                         case gMAN$
  736.                            KeywordValue$ = "0 (Manual)"
  737.                 END SELECT
  738.  
  739.           case "ProgramGroup"
  740.                 KeywordValue$ = Reg_GetProgManagerGroupName(1)
  741.                 sproggroup$ = "ProgramGroup:" + KeywordValue$
  742.  
  743.           case "Licenser"
  744.                 KeywordValue$ = "NOT IMPLEMENTED YET!!!" 
  745.         
  746.           case "LICDIR"
  747.                 KeywordValue$ = GetSymbolValue(SYM_LICDIR$)
  748.  
  749.           case "LICCOUNTDIR"
  750.                 n% = Reg_GetNumberOfProducts()
  751.                 FOR i% = 1 to n%
  752.                   IF Reg_GetProdSupportForLicense (i%) <> FALSE THEN
  753.                     licensedprod% = i%
  754.                     KeywordValue$ = Reg_GetCountDirectory(licensedprod%)
  755.                     EXIT FOR
  756.                   ELSE
  757.                     KeywordValue$ = "Licenser not supported"    
  758.                   END IF
  759.                 NEXT
  760.  
  761.           case "NodeOptions"
  762.                 KeywordValue$ = TBD$
  763.  
  764.           case "Consolidation"
  765.                 KeywordValue$ = TBD$
  766.  
  767.           case "LOTUSAPPDIR"
  768.                 slotusappdir$ = "Lotusapp Dir:" + KeywordValue$
  769.  
  770.           case "SQLServerName"
  771.                 KeywordValue$ = TBD$
  772.  
  773.           case "PARADOXNetInfo"
  774.                 KeywordValue$ = TBD$
  775.  
  776.           case "BASEDIR"
  777.                 KeywordValue$ =GetSymbolValue(SYM_BASEDIR$) 
  778.  
  779.           case "SizeofInstall"
  780.                 KeywordValue$ = GetSymbolValue(SYM_SIZEOFINSTALL$)
  781.  
  782.                 SELECT CASE KeywordValue$
  783.                         case gCOMPLETE$
  784.                            KeywordValue$ = "1 (Complete)"         
  785.                         case gLAPTOP$                
  786.                            KeywordValue$ = "2 (Laptop)"
  787.                         case gCUSTOM$
  788.                            KeywordValue$ = "3 (Custom)"
  789.                 END SELECT
  790.                 ssize$ = "SizeofInstall" + KeywordValue$        
  791.         
  792.           case "123"
  793.                 KeywordValue$ = TBD$
  794.  
  795.           case "AMI"
  796.                 KeywordValue$ = TBD$
  797.  
  798.           case "ORG"
  799.                 KeywordValue$ = TBD$
  800.  
  801.           case "APR"
  802.                 KeywordValue$ = TBD$
  803.  
  804.           case "123DIR"
  805.                 KeywordValue$ = GetSymbolValue(KeywordName$)
  806.  
  807.           case "123WORKDIR"
  808.  
  809.                 IF GetSymbolValue(SYM_NETWORK$) = gSTANDARD$  OR _
  810.                    GetSymbolValue(SYM_NETWORK$) = gNODE$ THEN
  811.                         KeywordValue$ = GetSymbolValue(KeywordName$) 
  812.                 ELSE
  813.                 KeywordValue$ = "Only supported in Standalone or Node"
  814.                 END IF
  815.  
  816.           case "Customize123"
  817.                 KeywordValue$ = TBD$
  818.  
  819.           case "AMIDIR"
  820.                 KeywordValue$ = GetListItem("AMIDIRS", 1) 
  821.  
  822.           case "ORGDIR"
  823.                 KeywordValue$ = GetListItem("ORGDIRS", 1) 
  824.        
  825.  
  826.         END SELECT 
  827.  
  828.         mybuffer$ = KeywordName$ + "="+ KeywordValue$
  829. '        notused% = WriteToFile(DebugLog$, mybuffer$)
  830.  
  831.         KeywordNumber% = KeywordNumber% + 1
  832.         KeywordTag$=KeywordPref$+LTRIM$(STR(KeywordNumber%))
  833.         KeywordName$ = GetIniKeyString(DebugIni$,SectionName$, KeywordTag$)
  834.         LOOP UNTIL KeywordName$ = ""
  835.  
  836. ELSE
  837.         mybuffer$ = mybuffer$ + " missing from RSP"        
  838. '        notused% = WriteToFile(DebugLog$, mybuffer$)
  839. END IF
  840.  
  841.  
  842. SectionNumber% = SectionNumber% + 1
  843. SectionTag$=SectionPref$+LTRIM$(STR(SectionNumber%))
  844. 'DoMsgBox("SectionTag$",SectionTag$ ,MB_OK)
  845. 'DoMsgBox("gSharedIniFile$ where used",gSharedIniFile$ ,MB_OK)
  846. SectionName$ = GetIniKeyString(DebugIni$,"Sections", SectionTag$)
  847. 'DoMsgBox("SectionName$",SectionName$ ,MB_OK)
  848. LOOP UNTIL SectionName$ = ""
  849.  
  850. Lot_AutoWriteOutDebugFile = 1
  851.  
  852. 'print sname$,,scompany$,, stype$,, sproggroup$,, slotusappdir$,, ssize$
  853.  
  854. NODEBUGLOG:
  855.  
  856. ELSE
  857.  
  858. END IF
  859.  
  860.  
  861. END FUNCTION
  862.  
  863. '*************************************************************************
  864. '** PUBLIC FUNCTION Lot_AutoIsThisNetLotusApp (LotusIniPath$,ExistingCommDir$) AS INTEGER
  865. '**
  866. '** Purpose:   Assums that at the prompt DBM_ISTHISNETLOTUSAPP the user
  867. '**            selected Yes and changes the lotus.ini accordingly
  868. '**            
  869. '** Author:    MZ
  870. '** Arguments: NONE
  871. '** Returns:   TRUE
  872. '** Replaces:  ISTHISNETLOTUSAPPCB
  873. '*************************************************************************
  874. PUBLIC FUNCTION Lot_AutoIsThisNetLotusApp (LotusIniPath$,ExistingCommDir$) AS INTEGER
  875. DIM path$, directory$
  876.  
  877.    path$ = LotusIniPath$
  878.    directory$  = ExistingCommDir$
  879.    CreateIniKeyValue path$, "Lotus Applications", "Net Common Directory", Lot_TrimEndSlash(directory$), cmoOverwrite
  880.    RemoveIniKey path$, "Lotus Applications", "Common Directory", cmoVital
  881.    Lot_AutoIsThisNetLotusApp = TRUE
  882.  
  883. END FUNCTION
  884.  
  885. '*************************************************************************
  886. '** PUBLIC FUNCTION Lot_AutoConsolidateMoveCopy () AS INTEGER
  887. '**
  888. '** Purpose:   Assums that at the prompt DBM_CONSOLIDATE_MOVECOPY the user
  889. '**            selected copy
  890. '**            
  891. '** Author:    MZ
  892. '** Arguments: NONE
  893. '** Returns:   TRUE
  894. '** Replaces:  CONSOLIDATEMOVECOPY
  895. '*************************************************************************
  896. PUBLIC FUNCTION Lot_AutoConsolidateMoveCopy () AS INTEGER
  897.    ' Is a copy
  898.    'print "copy"     
  899.    SetSymbolValue "SYM_MOVE", "0"
  900.    SetSymbolValue "SYM_COPY", "1"
  901.    Lot_AutoConsolidateMoveCopy = TRUE
  902. END FUNCTION
  903.  
  904. '*************************************************************************
  905. '** PUBLIC FUNCTION Lot_AutoConsolidateLotusAppDir (gConsolidateSize&) AS INTEGER
  906. '**
  907. '** Purpose:   Assums that at the prompt DBM_CONSOLIDATE_LOTUSAPPDIR the user
  908. '**            selected copy
  909. '**            
  910. '** Author:    MZ
  911. '** Arguments: NONE
  912. '** Returns:   TRUE
  913. '** Replaces:  CONSOLIDATELOTUSAPPDIRCB
  914. '*************************************************************************
  915. PUBLIC FUNCTION Lot_AutoConsolidateLotusAppDir (gConsolidateSize&) AS INTEGER
  916. DIM dirToChange$, notused%, Size&
  917.  
  918.    Size& = gConsolidateSize&
  919.    'Is a Copy
  920.    dirToChange$ = GetSymbolValue(SYM_LOTUSAPPDIR$)
  921.  
  922.    IF ValidatePath(dirToChange$) = FALSE THEN
  923. '      notused%=WriteToFile(GetSymbolValue(SYM_LOGGINGPATH$),"ERROR:"+dirToChange$)
  924.       dirToChange$ = GetSymbolValue(SYM_DEFAULT_LOTUSAPP$)
  925.       IF ValidatePath(dirToChange$) = FALSE THEN
  926. '         notused%=WriteToFile(GetSymbolValue(SYM_LOGGINGPATH$),"ERROR:"+dirToChange$)
  927.          ERROR STFQUIT
  928.          GOTO EXIT_CONSLOTUSAPPDIR
  929.       ELSE
  930.          GOTO NEXT_CONSOLIDATELOTUSAPPDIR
  931.       END IF
  932.    ELSE
  933.       'Validate the space
  934. NEXT_CONSOLIDATELOTUSAPPDIR:
  935.  
  936.       IF GetFreeSpaceForDrive(dirToChange$) < (Size& \ 1024) THEN
  937.          ShowPathError SID_DRV_NOTENOUGHSPACE, 0, dirToChange$
  938.          ERROR STFQUIT
  939.          GOTO EXIT_CONSLOTUSAPPDIR
  940.       END IF
  941.       'Validate the path against net lotus app
  942.       IF dirToChange$ = GetSymbolValue(SYM_EXISTINGNETCOMMDIR$) THEN
  943.          ShowPathError SID_ERR_SHARE_NETEQLOCAL1, SID_ERR_SHARE_NETEQLOCAL2, dirToChange$
  944.          ERROR STFQUIT
  945.          GOTO EXIT_CONSLOTUSAPPDIR
  946.       END IF
  947.    END IF
  948.       
  949.  
  950.    'Set the symbol to the new path
  951.    SetSymbolValue "SYM_MOVE", "0"
  952.    SetSymbolValue "SYM_COPY", "1"
  953.    SetSymbolValue SYM_LOTUSAPPDIR$, dirToChange$
  954.    SetSymbolValue SYM_LOTUSAPPEXISTS$,"1"
  955.    CreateDir dirToChange$, cmoNone
  956.    Lot_RefreshDestination(SYM_LOTUSAPPDIR$)
  957.    DL_SetNotesDataPath
  958.    DL_SetOraclePath
  959.  
  960.    Lot_AutoConsolidateLotusAppDir = TRUE
  961.  
  962. EXIT_CONSLOTUSAPPDIR:
  963.  
  964. END FUNCTION
  965. '*************************************************************************
  966. '** PUBLIC FUNCTION Lot_AutoChangeLotusAppDir () AS INTEGER
  967. '**
  968. '** Purpose:   Assums that at the prompt DBM_CHANGELOTUSAPPDIR the user
  969. '**            selected copy
  970. '**            
  971. '** Author:    MZ
  972. '** Arguments: NONE
  973. '** Returns:   TRUE
  974. '** Replaces:  CHANGELOTUSAPPDIRCB
  975. '*************************************************************************
  976. PUBLIC FUNCTION Lot_AutoChangeLotusAppDir () AS INTEGER
  977. DIM dirToChange$,dirSym$,notused%
  978.  
  979.    Lot_AutoChangeLotusAppDir = FALSE
  980.    dirToChange$ = GetSymbolValue(SYM_LOTUSAPPDIR$)
  981.    IF ValidatePath(dirToChange$) = FALSE THEN
  982.       dirToChange$ = GetSymbolValue(SYM_DEFAULT_LOTUSAPP$)
  983.       IF ValidatePath(dirToChange$) = FALSE THEN
  984.          ERROR STFQUIT
  985.          GOTO EXIT_CHANGELOTUSAPPDIR
  986.       END IF 
  987.    ELSE
  988.       dirSym$ = GetSymbolValue(SYM_CHANGEDIRSYMBOL$)
  989.       SetSymbolValue dirSym$, dirToChange$
  990.       Lot_RefreshDestination(dirSym$)
  991.    END IF
  992.    Lot_AutoChangeLotusAppDir = TRUE
  993. EXIT_CHANGELOTUSAPPDIR:
  994.  
  995. END FUNCTION
  996.  
  997. '*************************************************************************
  998. '** PUBLIC FUNCTION Lot_AutoSuiteAppSelect () AS INTEGER
  999. '**
  1000. '** Purpose:   reads in values from the response file for suite app.selection. 
  1001. '** Author:    Thangaraj Veerappan
  1002. '** Arguments: 
  1003. '** Returns:   TRUE or FALSE
  1004. '** Replaces:   
  1005. '*************************************************************************
  1006. PUBLIC FUNCTION Lot_AutoSuiteAppSelect () AS INTEGER
  1007.     DIM Selection%, lname$, prodno%, nProds%
  1008.     DIM sname$, rspval$    
  1009.  
  1010.    Lot_AutoSuiteAppSelect = FALSE
  1011.  
  1012.    sname$ = "Select Applications"     
  1013.    
  1014.    nProds% = Reg_GetNumberOfProducts()
  1015.  
  1016.    If GetSymbolValue(SYM_SINGLESMARTSUITE$)= gSMARTSUITE$ Then
  1017.       For prodno% = 2 to nProds%
  1018.          lname$ = Reg_GetProductAcronym(prodno%)
  1019.          IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" Then
  1020.                rspval$ = Lot_GetKeyValFromResponseFile(sname$, lname$)
  1021.                IF rspval$ <> "" THEN
  1022.                  Selection% = CINT(rspval$)
  1023.                ELSE
  1024.                  Selection% = -1
  1025.                END IF  
  1026.            IF Selection% <> 0 AND Selection% <> 1 THEN
  1027.           '** Error in response file
  1028.              ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_SELECTAPPS)
  1029.              ERROR STFQUIT
  1030.            ELSE
  1031.           Reg_SetUIInOrOut prodno%, Selection%
  1032.            END IF
  1033.                      
  1034.       END IF    
  1035.       Next
  1036.    End IF
  1037.  
  1038.    Lot_AutoSuiteAppSelect = TRUE
  1039.  
  1040. END FUNCTION
  1041.  
  1042. '*************************************************************************
  1043. '** PUBLIC FUNCTION Lot_AutoProcessNodeOptions () AS INTEGER
  1044. '**
  1045. '** Purpose:   reads in values from the response file for node options and does
  1046. '**            the processing. 
  1047. '** Author:    Thangaraj Veerappan
  1048. '** Arguments: 
  1049. '** Returns:   TRUE or FALSE
  1050. '** Replaces:   
  1051. '*************************************************************************
  1052. PUBLIC FUNCTION Lot_AutoProcessNodeOptions () AS INTEGER
  1053.  
  1054. DIM AllProdNum%,prodNum%,AllOptNum%,OptName$,OptNum%,notused%
  1055. DIM nodeoption%, Chapter$, lname$, rspval$
  1056.  
  1057. Lot_AutoProcessNodeOptions = FALSE
  1058.  
  1059. lname$ = "Node Install"
  1060.  
  1061.       'Change the selection for Node options
  1062.     IF Lot_IsAnyNodeOptAvailToNode() <> 0 THEN
  1063.          rspval$ = Lot_GetKeyValFromResponseFile(lname$, "NodeOptions")
  1064.  
  1065.          IF rspval$ <> "" THEN
  1066.              nodeoption% = CINT(rspval$)
  1067.          ELSE
  1068.                  nodeoption% = -1
  1069.          END IF                
  1070.  
  1071.        IF nodeoption% <> 0 AND nodeoption% <> 1 THEN
  1072.         '** Error in response file
  1073.         ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_NODEOPTIONS) + "  " + lname$
  1074.             ERROR STFQUIT
  1075.        ELSE
  1076.       IF nodeoption% = 0 THEN
  1077.         'Loop through the products and turn the options off
  1078.         AllProdNum% = 0
  1079.             AllProdNum% = Reg_GetNumberOfProducts()
  1080.           IF AllProdNum% <> 0 THEN
  1081.            FOR prodNum%=1 TO AllProdNum%
  1082.           AllOptNum% = 0
  1083.           AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  1084.           IF AllOptNum% <> 0 THEN
  1085.              'Loop though registered options and turn them of 
  1086.              FOR OptNum%=1 TO AllOptNum% 
  1087.             OptName$ = Reg_GetNodeOptionStr(prodNum%,OptNum%)
  1088.             Chapter$ = Lot_GetChapterFromKeyword(OptName$)
  1089.             notused% = Lot_SetChapterFilesInCopyListInOrOut(Chapter$,0)
  1090.              NEXT
  1091.           END IF
  1092.            NEXT
  1093.         END IF
  1094.       ELSE
  1095.         'Loop through the products and turn the options on
  1096.         AllProdNum% = 0
  1097.         AllProdNum% = Reg_GetNumberOfProducts()
  1098.         IF AllProdNum% <> 0 THEN
  1099.            FOR prodNum%=1 TO AllProdNum%
  1100.           AllOptNum% = 0
  1101.           AllOptNum% = Reg_GetNumofNodeOptions(prodNum%)
  1102.           IF AllOptNum% <> 0 THEN
  1103.              'Loop though registered options and turn them on
  1104.              FOR OptNum%=1 TO AllOptNum% 
  1105.             OptName$ = Reg_GetNodeOptionStr(prodNum%,OptNum%)
  1106.             Chapter$ = Lot_GetChapterFromKeyword(OptName$)
  1107.                         IF Lot_IsTheNodeOptionsAvailToNode(prodNum%,OptName$) = 1 THEN
  1108.                notused% = Lot_SetChapterFilesInCopyListInOrOut(Chapter$,1)
  1109.                         END IF
  1110.              NEXT
  1111.           END IF
  1112.            NEXT
  1113.         END IF
  1114.       END IF
  1115.        END IF
  1116.     END IF
  1117.  
  1118. Lot_AutoProcessNodeOptions = TRUE
  1119.  
  1120. END FUNCTION
  1121.  
  1122. '*************************************************************************
  1123. PUBLIC FUNCTION Lot_AutoGetSetLicenserInfo () AS INTEGER
  1124. '** Purpose:    Get the destination directory symbols
  1125. '**             from the RSP file -- used in AUTOMATION             
  1126. '**             
  1127. '** Author:     Jill Salter Plump     
  1128. '** Arguments:  
  1129. '** Returns:    TRUE if successful    
  1130. '**             
  1131. '*************************************************************************
  1132. STATIC licselected%, licensedprod% 
  1133. DIM i%, n%, dirtochange$, lname$
  1134. DIM chpt$, notused%, countdir$
  1135. DIM firstslash%, lastslash%, fullpath$
  1136. DIM countbasedir$, counttaildir$, rspval$
  1137.  
  1138.    Lot_AutoGetSetLicenserInfo = FALSE
  1139.  
  1140.    lname$ = "Server Install"
  1141.  
  1142.    licensedprod% = 0
  1143.    licselected% = 0
  1144.    n% = Reg_GetNumberOfProducts()
  1145.  
  1146.    '** FIND THE FIRST LICENSED PRODUCT. ONLY WORKS FOR SINGLE PRODUCT!
  1147.    FOR i% = 1 to n%
  1148.       IF Reg_GetProdSupportForLicense (i%) <> FALSE THEN
  1149.          licensedprod% = i%
  1150.          EXIT FOR
  1151.       END IF
  1152.    NEXT
  1153.  
  1154.    IF licensedprod% <> 0 THEN
  1155.  
  1156.       rspval$ = Lot_GetKeyValFromResponseFile (lname$, "Licenser")
  1157.  
  1158.       IF rspval$ <> "" THEN
  1159.          licselected% = CINT(rspval$)
  1160.       ELSE
  1161.          ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICENSER) + "  " + lname$
  1162.          ERROR STFQUIT        
  1163.       END IF                
  1164.  
  1165.    END IF
  1166.  
  1167.    IF GetSymbolValue(SYM_SINGLESMARTSUITE$) = gSMARTSUITE$ THEN
  1168.           '** For suite propagate the lic. selection to all products
  1169.     '** that are selected and support lic.
  1170.           FOR i% = 1 to n%
  1171.          IF Reg_GetProdSupportForLicense (i%) <> FALSE AND _
  1172.         Reg_GetUIInOrOut(i%) <> FALSE  THEN
  1173.           Reg_SetLicenseSelected i%, licselected%
  1174.          END IF
  1175.           NEXT
  1176.       ELSE    
  1177.      Reg_SetLicenseSelected licensedprod%, licselected%
  1178.       END IF
  1179.  
  1180. IF licselected% = 1 THEN
  1181.       '** CONFIGURE COPYLIST TO ACCOUNT FOR LICENSER FILES
  1182.       IF Reg_IsLicenseSelected(licensedprod%) <> FALSE Then
  1183.          chpt$ = Lot_GetChapterFromKeyword("LIC" + gTOP$)
  1184.          notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 1)    
  1185.       ELSE
  1186.          chpt$ = Lot_GetChapterFromKeyword("LIC" + gTOP$)
  1187.          notused% = Lot_SetChapterFilesInCopyListInOrOut(chpt$, 0)
  1188.       END IF
  1189.  
  1190.       IF Reg_IsLicenseSelected(licensedprod%) <> FALSE Then
  1191.          '** ACCOUNT FOR LOTUS LICENSER DIRECTORY CHANGE
  1192.          dirtochange$ = Lot_GetKeyValFromResponseFile ("Server Install", "LICDIR")  
  1193.          IF Lot_AutoCheckRSPPath(dirtochange$) <> "" THEN
  1194.              SetSymbolValue SYM_LICDIR$, dirtochange$
  1195.              Lot_RefreshDestination(SYM_LICDIR$)
  1196.           ELSE
  1197.              ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICDIR) + "  " + lname$
  1198.          ERROR STFQUIT
  1199.       END IF
  1200.  
  1201.           '** ACCOUNT FOR LOTUS COUNT DIRECTORY CHANGE
  1202.           dirtochange$ = Lot_GetKeyValFromResponseFile (lname$, "LICCOUNTDIR")   
  1203.            IF Lot_AutoCheckRSPPath(dirtochange$) = "" THEN
  1204.              ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICDIR) + "  " + lname$
  1205.          ERROR STFQUIT
  1206.        END IF
  1207.            licensedprod% = 0
  1208.            FOR i% = 1 to Reg_GetNumberofProducts()
  1209.                IF Reg_GetProdSupportForLicense(i%) <> FALSE THEN
  1210.                    licensedprod% = i%
  1211.                    countdir$ = Lot_TrimEndSlash(Reg_GetCountDirectory(licensedprod%))
  1212.                    firstslash% = INSTR(countdir$, "\") : lastslash% = firstslash%
  1213.                    WHILE firstslash% <> 0
  1214.                        lastslash% = firstslash% : firstslash% = INSTR(firstslash%+1, countdir$, "\")
  1215.                    WEND
  1216.                    countdir$ = countdir$ + "\"
  1217.                    counttaildir$ = RIGHT$(countdir$, LEN(countdir$) - lastslash%)
  1218.                    fullpath$ = MakePath(dirtochange$, counttaildir$)
  1219.                 IF ValidatePath(fullpath$) <> FALSE THEN
  1220.                        Reg_SetCountDirectory licensedprod%, fullpath$
  1221.                    ELSE
  1222.                                 ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_LICCOUNTDIR) + "  " + lname$
  1223.                     ERROR STFQUIT
  1224.                    END IF
  1225.                END IF
  1226.            NEXT
  1227.       END IF
  1228.  
  1229. END IF                  'licselected = TRUE
  1230.  
  1231.  
  1232.  
  1233. Lot_AutoGetSetLicenserInfo = TRUE
  1234.  
  1235. END FUNCTION
  1236.  
  1237.  
  1238. '*************************************************************************
  1239. '** PUBLIC FUNCTION Lot_AutoInstallCustomize () AS INTEGER
  1240. '**
  1241. '** Purpose:   reads in values from the response file. 
  1242. '** Author:    Thangv
  1243. '** Arguments:   
  1244. '** Returns:   TRUE if successful
  1245. '*************************************************************************
  1246. PUBLIC FUNCTION Lot_AutoInstallCustomize () AS INTEGER
  1247. DIM tabchpt$, prodfeaturechpt$, RspInOrOut%, Rspval$
  1248. DIM lname$, rc%, prodno%, n%, chpt$, tab_name$, prodfeature$ 
  1249.  
  1250.     Lot_AutoInstallCustomize = FALSE
  1251.  
  1252.     n% = Reg_GetNumberOfProducts()
  1253.     For prodno% = 1 to n%
  1254.       lname$ = Reg_GetProductAcronym(prodno%)
  1255.       IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" AND _
  1256.          lname$ <> "SUIT"  Then
  1257.         IF Reg_GetUIInOrOut (prodno%) = 1 AND _
  1258.        Reg_GetProdSelectedInstallType (prodno%) = gCUSTOM$ THEN
  1259.         chpt$ = Lot_GetChapterFromKeyword(lname$ + gTOP$)
  1260.         '** DND: If no first chapter then we need to do somthing
  1261.         prodfeaturechpt$  = Lot_GetFirst(chpt$, F_DISPLAY + F_CUSTOM)
  1262.         WHILE (prodfeaturechpt$ <> "")
  1263.            prodfeature$ = Lot_GetChapterValStr (prodfeaturechpt$, F_KEYWORD)
  1264.            Rspval$ = Lot_GetKeyValFromResponseFile("Customize"+lname$,prodfeature$)
  1265.            '** script bug work around: generates Type mismatch and crashes
  1266.            IF Rspval$ <> "" THEN
  1267.                 RspInOrOut% = CINT(Rspval$)
  1268.  
  1269.                   IF RspInOrOut% <> 0 AND RspInOrOut% <> 1 THEN
  1270.                      ErrorMsg SID_ERR_AUTO_INSTALL, "Feature selection entry in response file invalid: " + prodfeature$
  1271.                 ERROR STFQUIT
  1272.                     END IF
  1273.                     rc% = Lot_SetChapterFilesInCopyListInOrOut(prodfeaturechpt$,RspInOrOut%)
  1274.            END IF
  1275.                '*** Goto next sibbling feature chpt$
  1276.            prodfeaturechpt$ = Lot_GetNext()  
  1277.          WEND
  1278.  
  1279.     END IF
  1280.       END IF
  1281.     Next
  1282.  
  1283. Lot_AutoInstallCustomize = TRUE
  1284.  
  1285. END FUNCTION
  1286.  
  1287. '*************************************************************************
  1288. '** PUBLIC FUNCTION Lot_AutoCustomizeShare () AS INTEGER
  1289. '**
  1290. '** Purpose:   reads in values from the response file. 
  1291. '** Author:    Thangv
  1292. '** Arguments:   
  1293. '** Returns:   TRUE if successful
  1294. '*************************************************************************
  1295. PUBLIC FUNCTION Lot_AutoCustomizeShare () AS INTEGER
  1296. DIM sharechpt$, RspInOrOut%, Rspval$, prodchpt$
  1297. DIM lname$, rc%, n%, chpt$, sharefeature$,prodkeyword$
  1298.  
  1299.     Lot_AutoCustomizeShare = FALSE
  1300.  
  1301.     lname$ = Reg_GetProductAcronym(1)
  1302.     sharechpt$ = Lot_GetFirst("", F_DISPLAY + F_CUSTOM + F_SHARE)
  1303.                   
  1304.     '** DND: If no first chapter then we need to do somthing
  1305.         
  1306.     WHILE (sharechpt$ <> "")
  1307.  
  1308.       '** for the shared chpt check if the product it belongs to
  1309.       '** is in the copylist. 
  1310.       '** Only the shared chpt$ of a product being installed
  1311.       '** is processed. This works as long as the same shared keywords are
  1312.       '** listed in all the products for a specific shared feature.
  1313.  
  1314.       prodchpt$ = LEFT$(sharechpt$,1)
  1315.       prodkeyword$ = Lot_GetChapterValStr (prodchpt$, F_KEYWORD)
  1316.       IF FIsKeywordinCopyList (prodkeyword$) <> FALSE THEN
  1317.      sharefeature$ = Lot_GetChapterValStr (sharechpt$, F_KEYWORD)
  1318.      IF LEFT$(sharefeature$,5) = "WIN32" THEN
  1319.         '** 32 bit shared component
  1320.               Rspval$ = Lot_GetKeyValFromResponseFile("Shared Components", sharefeature$)
  1321.      ELSE
  1322.         '** 16 bit lotusapp component        
  1323.               Rspval$ = Lot_GetKeyValFromResponseFile("Lotusapp",sharefeature$)
  1324.            END IF
  1325.           '** script bug work around: generates Type mismatch and crashes
  1326.           IF Rspval$ <> "" THEN
  1327.               RspInOrOut% = CINT(Rspval$)
  1328.               IF RspInOrOut% <> 0 AND RspInOrOut% <> 1 THEN
  1329.                ErrorMsg SID_ERR_AUTO_INSTALL, LdString (SID_ERR_AUTO_SHRCOMPNENT) + sharefeature$
  1330.                ERROR STFQUIT
  1331.               END IF
  1332.            rc% = Lot_SetChapterFilesInCopyListInOrOut(sharechpt$,RspInOrOut%)
  1333.           ELSE
  1334.       '*** Log error: feature missing from the response file    
  1335.           END IF
  1336.       END IF
  1337.       '*** Goto next shared feature chpt$
  1338.       sharechpt$ = Lot_GetNext()  
  1339.     WEND
  1340.  
  1341. Lot_AutoCustomizeShare = TRUE
  1342.  
  1343. END FUNCTION
  1344.  
  1345. '*************************************************************************
  1346. '** PUBLIC FUNCTION Lot_AutoInstallSuiteCustomize () AS INTEGER
  1347. '**
  1348. '** Purpose:   reads in values from the response file. 
  1349. '** Author:    Thangv
  1350. '** Arguments:   
  1351. '** Returns:   TRUE if successful
  1352. '*************************************************************************
  1353. PUBLIC FUNCTION Lot_AutoInstallSuiteCustomize () AS INTEGER
  1354.  
  1355.     Lot_AutoInstallSuiteCustomize = FALSE
  1356.  
  1357.     DIM sizetype$, direction$ 
  1358.     DIM lname$, rc%, prodno%, n%  
  1359.     n% = Reg_GetNumberOfProducts()
  1360.     For prodno% = 1 to n%
  1361.       lname$ = Reg_GetProductAcronym(prodno%)
  1362.       IF lname$ <> "" AND lname$ <> "INST" AND lname$ <> "LIC" AND _
  1363.          lname$ <> "SUIT"  Then
  1364.        IF Reg_GetUIInOrOut(prodno%) = 1 THEN
  1365.           sizetype$ = Lot_GetKeyValFromResponseFile(lname$,"SizeOfInstall")
  1366.             IF sizetype$ = "" THEN
  1367.             ErrorMsg SID_ERR_AUTO_INSTALL, "SizeOfInstall entry missing from section: " + lname$
  1368.             ERROR STFQUIT
  1369.          END IF
  1370.           If sizetype$ = "1" Then      '*** gCOMPLETE$ 
  1371.             Reg_SetSelectedInstallType prodno%, gCOMPLETE$
  1372.             direction$ = Lot_CallOneProductFunction(prodno%, "InitCopyList", gNEXT, TRUE, "")
  1373.          ElseIf sizetype$ = "2" Then     '*** gLAPTOP$
  1374.             Reg_SetSelectedInstallType prodno%, gLAPTOP$
  1375.             direction$ = Lot_CallOneProductFunction(prodno%, "InitCopyList", gNEXT, TRUE, "")
  1376.          End If
  1377.        END IF
  1378.       END IF
  1379.     Next
  1380. Lot_AutoInstallSuiteCustomize = TRUE
  1381.  
  1382. END FUNCTION
  1383.  
  1384. '*************************************************************************
  1385. PUBLIC SUB AutoSetParentDir 
  1386. '** Purpose:    Get the PARENTDIR symbol (for Single product),
  1387. '**             from the RSP file -- used in AUTOMATION             
  1388. '**             
  1389. '** Author:     TV     
  1390. '** Arguments:  
  1391. '** Returns:        
  1392. '**                         
  1393. '*************************************************************************
  1394. DIM notused%, lname$
  1395. DIM parentdirectory$
  1396.  
  1397.     '*** single product no is always 1 *****
  1398.     lname$ = Reg_GetProductAcronym(1)
  1399.     parentdirectory$ = Lot_GetKeyValFromResponseFile (lname$,SYM_BASEDIR$)
  1400.  
  1401.     parentdirectory$ = Lot_AutoCheckRSPPath(parentdirectory$)
  1402.  
  1403.     IF LEN(parentdirectory$)  < 1 THEN
  1404.            ErrorMsg SID_ERR_AUTO_INSTALL, LdString(SID_ERR_AUTO_BASEDIR) + "  " + lname$
  1405.            ERROR STFQUIT
  1406.     END IF
  1407.     
  1408.     SetSymbolValue SYM_PARENTDIR$, parentdirectory$ 
  1409.  
  1410. END SUB
  1411.  
  1412. '*************************************************************************
  1413. '** PUBLIC FUNCTION Lot_AutoSetSrvNodeOptions () AS INTEGER
  1414. '**
  1415. '** Purpose:   reads in values from the response file. 
  1416. '** Author:    Thangv
  1417. '** Arguments:   
  1418. '** Returns:   TRUE if successful
  1419. '*************************************************************************
  1420. PUBLIC FUNCTION Lot_AutoSetSrvNodeOptions () AS INTEGER
  1421.  
  1422.    DIM chpt$, nodesel%, nodeoptsel$
  1423.    DIM NumOfProds%, OptNum%, OptName$, ProdNum%, prodno$
  1424.    DIM i%, j%,k%, notused%, OptKeyWord$
  1425.    DIM lname$    
  1426.    
  1427.    ' If no products are registered exit
  1428.    NumOfProds% = Reg_GetNumberOfProducts()
  1429.    IF NumOfProds%=0 THEN
  1430.       Lot_AutoSetSrvNodeOptions = TRUE
  1431.       EXIT FUNCTION
  1432.    END IF
  1433.    
  1434.    Lot_AutoSetSrvNodeOptions = FALSE
  1435.  
  1436.       ' Loop through products
  1437.      FOR i% = 1 TO NumOfProds%
  1438.      lname$ = "CustomizeNodeOptions" + Reg_GetProductAcronym(i%)
  1439.      Reg_ReSetAllNodeOptsSelToDefaults i%
  1440.      OptNum%=Reg_GetNumofNodeOptions(i%)
  1441.      IF OptNum% <> 0 THEN
  1442.         chpt$ = Lot_GetChapterFromKeyword(Reg_GetProductAcronym(i%) + gTOP$)
  1443.  
  1444.        ' Loop through the options
  1445.        FOR j% = 1 TO OptNum%
  1446.         ' Indent the option name under the product
  1447.         OptKeyWord$ = Reg_GetNodeOptionStr(i%,j%)
  1448.         chpt$ = Lot_GetChapterFromKeyword(OptKeyWord$)
  1449.         IF INT(Lot_GetChapterValInt(chpt$,F_INOROUT)) = 1 THEN
  1450.               nodeoptsel$ = Lot_GetKeyValFromResponseFile(lname$, OptKeyWord$) 
  1451.           'IF nodeoptsel$ <> "0" AND nodeoptsel$ <> "1" THEN
  1452.               '  ErrorMsg SID_ERR_AUTO_INSTALL, "Auto install error"
  1453.           '    ERROR STFQUIT
  1454.           'END IF
  1455.           IF nodeoptsel$ = "0" OR nodeoptsel$ = "1" THEN
  1456.              nodesel% = CINT (nodeoptsel$)    
  1457.                   Reg_ReSetNodeOptionSelected i%,j%,nodesel%
  1458.           END IF
  1459.  
  1460.         END IF
  1461.        NEXT
  1462.  
  1463.      END IF
  1464.      NEXT
  1465.  
  1466. Lot_AutoSetSrvNodeOptions = TRUE
  1467.  
  1468. END FUNCTION
  1469.